<?php

namespace App\Http\Controllers;

use App\Models\Article;
use Illuminate\Http\Request;

class ArticleController extends Controller
{
    // 文章详情
    public function detail(Request $request, $id)
    {
        $article = Article::with('category')->with('tags')->find($id);
        if (!$article) {
            abort(404, "未找到！");
        }
        return view('detail', ['article' => $article]);
    }
}
